//
//  ReactView.m
//  navDemo
//
//  Created by 任征 on 2017/3/24.
//  Copyright © 2017年 Facebook. All rights reserved.
//

#import "ReactView.h"
#import <React/RCTBundleURLProvider.h>

@implementation ReactView

- (instancetype)initWithFrame:(CGRect)frame properties:(NSDictionary *)props options: (NSDictionary *)option {
  if (self = [super initWithFrame:frame]) {
    NSURL *jsCodeLocation;
    
    jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
    
    RCTRootView * rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                         moduleName:@"navDemo"
                                                  initialProperties:props
                                                      launchOptions:option];
    
    [self addSubview:rootView];
    
    rootView.frame = self.bounds;
  }
  return self;
}


@end
